package com.ww.springboot.boot.thread.study.base.lock.aqs.paint;

import com.ww.springboot.boot.thread.study.base.lock.aqs.demo.lock1.MySimpleLock;

/**
 * 描述：
 *
 * @author 🧑 ‍wanwei
 * @since 2023-03-18 14:20
 */
public class Test {

    public static void main(String[] args) throws InterruptedException {
        MySimpleLock mySimpleLock = new MySimpleLock();
        for (int i = 0; i < 10; i++) {
            Thread.sleep(1000);
            new Thread(() -> {
                mySimpleLock.lock();
                try {
                    Thread.sleep(10000);
                } catch (Exception e) {

                } finally {
                    mySimpleLock.unlock();
                }
            }).start();
        }

    }
}
